package com.octopus.yangj.customized.controller;

import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.sql.DataSource;

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.octopus.kernal.service.BusinessModelService;
import com.octopus.kernal.util.xml.Entity;
import com.octopus.yangj.generated.controller.SearchEmployeeCommand;
import com.octopus.yangj.generated.controller.SearchEmployeeRoleCommand;
import com.octopus.yangj.generated.model.*;
import com.octopus.yangj.customized.service.CustomizedEventService;
import com.octopus.yangj.customized.service.RealmService;
import com.octopus.yangj.generated.service.*;
import com.wushi.yangjing.EventMgtImp;
import com.wushi.yangjing.EventMgtInf;

/**
 * Web controller used when loading the home page.
 */
@SuppressWarnings("unused")
@Controller
@RequestMapping("/test.o")
public class TestController {

    @Autowired
    private EmployeeService userService;
    
    @Autowired
    private BusinessModelService businessModelService;
    
    @Autowired
    private EmployeeRoleService roleService;
    
    @Autowired
	private CustomizedEventService eventService;
    
    private DataSource dataSource;
    
    @Autowired
    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

	@RequestMapping
    public String test(Model model) {
    	
//    	JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();  
//        factory.setServiceClass(EventMgtInf.class);  
//        factory.setAddress("http://localhost:8081/yangj/webservices/setEventResult");  
//        EventMgtInf helloworld = (EventMgtInf) factory.create();  
//        System.out.println(helloworld.setEventResult("wgEventId", "eventResult", new Date(), "handleDpt", "preHandleImg", "postHandleImg"));  
        
        eventService.getFeedbackFromUnit();
    	
    	System.out.println("ok");
    	
    	return "common/test";
    }

}
